fix: set TTL on Celery pidbox reply keys to prevent Redis memory leak#559
fix: set TTL on Celery pidbox reply keys to prevent Redis memory leak#559bartmichalak wants to merge 1 commit intomainfrom
Conversation
|
🚅 Deployed to the open-wearables-pr-559 environment in Open Wearables
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@CodeRabbit could you confirm that these changes won't affect any logic related to background jobs, scheduled tasks, etc? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 4575
What What remains completely unchanged:
The 300s TTL is also a safe window — control commands complete in milliseconds to seconds, so there is no risk of evicting an in-flight reply. The change is a net positive: it prevents orphaned pidbox reply keys from accumulating in Redis indefinitely. |
Description
The change adds two configuration parameters to Celery (control_queue_ttl=300, control_queue_expires=300) in core.py:54-55.
What these parameters do:
Problem:
Celery creates temporary pidbox reply keys in Redis every time a worker responds to control commands (e.g. celery inspect). Without a TTL, these keys persist in Redis indefinitely, causing a memory leak.
Impact on existing logic:
Checklist
General
Backend Changes
You have to be in
backenddirectory to make it work:uv run pre-commit run --all-filespassesFrontend Changes
NA
Testing Instructions
Screenshots
NA
Additional Notes
NA